package com.ndd.controller;

import com.ndd.result.R;
import com.ndd.service.ProductService;
import com.ndd.vo.ProductVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ProjectName: cmall-ybu
 * @Titile: ProductController
 * @Author: Lucky
 * @Description: 商品控制类
 */
@RestController
@RequestMapping("api/product")
public class ProductController {
    @Autowired
    private ProductService productService;

    /**
     * 新到好货
     * @return
     */
    @GetMapping("newList")
    public R<List<ProductVO>> getNewProductList(){
        List<ProductVO> newProductList = productService.getNewProductList();
        return R.ok(newProductList);
    }
}
